class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.integer :user_id
      t.integer :post_id
      t.string  :username
      t.string  :email
      t.text    :content
      t.string  :ip, :default => '未知'
      t.string  :website, :default => 'http://www.rubyfans.com'
      t.timestamps
    end
    add_index :comments, :user_id
    add_index :comments, :post_id
  end

  def self.down
    drop_table :comments
  end
end
